//必须带done回调 执行完成调用

import isEmpty from 'lodash/isEmpty'

// import Actions from '../../index'

// import cloneDeep from 'lodash/cloneDeep'

export default function callMethod({ vm, action, done, callbackData }) {
  let moduleId = action.extension.moduleId.value[0]
  let eventValue = action.extension.moduleId.eventValue
  const formItem = vm.vuiComponents[moduleId] //获取选中得组件
  // if (!isEmpty(eventValue)) {
  //   formItem.self[eventValue]()
  // }
  if (!isEmpty(eventValue)) {
    formItem.self.runEventTask(eventValue, '', () => {
      done(null, callbackData)
    })
  } else {
    done(null, {})
  }

  // done(null, {})

  // done(null, {})
}
